/**
 * 选择日期页面
 * @author yuan_rz
 * @date 2019/03/13 16:10
 */
define(function () {

    var self,
        app = win.app,
        doc = document,
        vueData = {
            label:'',
            form: {
                date: ''
            }
        },
        cb
    ;

    app.newModule({
        init: function () {
            self = this;
            self._super({
                _tag: 'common_open_date'
            }, win);
        },
        _call: function (tagData) {
            //label
            vueData.label = tagData.label;
            //点击确认时的回调
            cb = tagData.cb;
        },
        _ready: function () {
            var vue = new Vue({
                el: '#common_open_date',
                data: vueData,
                methods: {
                    cancel: function () {
                        self._closeTpl();
                    },
                    sure: function () {
                        if(cb){
                            cb(vueData.form.date);
                        }
                        self._closeTpl();
                    }
                },
                created: function () {
                    self._setEleIsReady('common_open_date');
                }
            });
        },
        _lazy: function () {
            this._super();
        }
    });

});